package com.project.psc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.psc.bean.StoreBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IStoreMapper extends BaseMapper<StoreBean> {
    @Select("SELECT DISTINCT(s.s_type) FROM t_store s")
    public List<String> findAllType();

    @Select("SELECT DISTINCT(s.s_brand) FROM t_store s")
    public List<String> findAllBrand();

    public IPage<StoreBean> cutByItem(Page pg,
                                      @Param("goodsName") String goodsName,
                                      @Param("type") String type,
                                      @Param("brand") String brand,
                                      @Param("supplierId") Long supplierId
    );
}
